#pragma once
#include "Vec3D.h"
#include "StatusAttributes.h"
#include <Xors3d.h>
#include <vector>

class Character
{
protected:
	Handle mesh;
	StatusAttributes mAttributes;
	Vec3D mDestination;
	Character *mAttacker;
	unsigned int lastKick;
public:
	Character();

	Character(float x, float y, float z);

	virtual ~Character();

	bool Attaced();

	void SetDirection(const Vec3D& dir);

	Character *SelectedEnemy(const std::vector<Character*> &enemies);

	Vec3D GetPosition() const;

	Vec3D GetDestination() const;

	void MoveToPoint(const Vec3D& dest);
	
	void Move();

	float DistanceTo(const Vec3D& point) const;

	bool InPosition(const Vec3D& position) const;

	void DealDamage(Character* target);

	Handle GetMesh() const {return mesh;}

	void SetDestination(const Vec3D& dest) { mDestination = dest; }

	StatusAttributes Attributes() {return mAttributes;}

	bool IsDead();

	virtual void Update() = 0;
};